<template>
  <the-table :columns="columns" uri="s/buys">
    <span slot="action" slot-scope="{ row }">
      <a class="ant-dropdown-link"><a-icon type="edit" /> 编辑 </a>
    </span>
  </the-table>
</template>
<script>
import theTable from '@/components/theTable.vue'

const columns = [
  {
    title: '订单号',
    dataIndex: 'id',
    searchAble: true,
  },
  {
    title: '币值',
    dataIndex: 'coins',
  },
  {
    title: '银行',
    dataIndex: 'bank',
    width: 120,
  },
  {
    title: '银行卡',
    dataIndex: 'bankcard',
  },
  {
    title: '开户人',
    dataIndex: 'realname',
    width: 80,
  },
  {
    title: '下发时间',
    dataIndex: 'created_at',
  },
  // {
  //   title: '接单用户',
  //   dataIndex: 'member.user.username',
  //   searchAble: true,
  //   width: 100,
  // },
  {
    title: '状态',
    dataIndex: 'state',
    dataType: 'select',
    searchAble: true,
    search: {
      // 'done','locking', 'checking'
      selectOptions: [
        { title: '已锁单', value: 'locking' },
        { title: '审核中', value: 'checking' },
        { title: '已完成', value: 'done' },
      ],
    },
    width: 80,
    customRender: (val) => {
      const map = new Map([
        ['locking', '已锁单'],
        ['checking', '审核中'],
        ['done', '已完成'],
      ])
      return map.get(val)
    },
  },
  // {
  //   title: '操作',
  //   key: 'action',
  //   scopedSlots: { customRender: 'action' },
  //   width: 80,
  // },
]

export default {
  components: { theTable },

  data() {
    return {
      columns,
    }
  },
  computed: {},
  mounted() {},
  methods: {},
}
</script>
